define(['../common/getPath', '../common/dateFormat'],function(AjaxPath){
    var fileList = function (data,fileId){
        var fileListStr='';
        "use strict";
        for (var i = 0; i < data.length; i++) {
            if(fileId){
                fileId.push(data[i].id);
            }

            var fileSize=(data[i].fileSize/1024>1024) ? ((data[i].fileSize/1024/1024>1024) ? (data[i].fileSize/1024/1024/1024).toFixed(2)+' GB' : (data[i].fileSize/1024/1024).toFixed(2)+' MB') : (data[i].fileSize/1024).toFixed(2)+' KB';
            var fileTime=new Date(data[i].createTime*1000 );

            fileListStr += '<tr class="template-upload">' +
                '<td>' +
                    '<div style="width:415px;" class="upload-filename">' +
                        '<a href="'+ AjaxPath.project +'/uploadFile/download?id='+data[i].id+'">'+data[i].fileName+'</a>' +
                    '</div>' +
                '</td>' +
                '<td>' +
                    '<div style="width:150px;padding:0;" class="upload-byte">'+fileSize+'</div>' +
                '</td>' +
                '<td>' +
                    '<div style="width:150px;" class="upload-time">'+new Date(data[i].createTime).Format('yyyy-MM-dd hh:mm:ss')+'</div>' +
                '</td>' +
                '<td style="width:150px;">' +
                    '<div class="sn-upload-fileResult"></div>' +
                    '<div class="upload-btns"><a class="uploadDelete t-btn t-btn-blue t-btn-xs" data="'+data[i].id+'" style="color: #fff">删除</a></div>' +
                '</td>' +
            '</tr>'
        };
        return fileListStr;
    };

    return fileList;

});

